<%@page import="com.weibo.pojo.User"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
</head>

<body>
	<c:choose>
		<c:when test="${user == null}">
			<a href="signin">登录</a>
			<a href="signup">注册</a>
		</c:when>
		<c:otherwise>
			<table>
				<tr>
					<td colspan="3">${user.username}</td>
				</tr>
				<tr>
					<td>关注： <a href="listUser?initiativeId=${user.userId}">
							${user.concernNum} </a></td>
					<td>粉丝： <a href="listUser?passivityId=${user.userId}">
							${user.fansNum} </a></td>
					<td>微博：
						<a href="listMicroblog?user.userId=${user.userId}">${user.microblogNum}</a>
					</td>
				</tr>
			</table>
			<a href="quit">退出</a>
			<form action="listMicroblog" method="post">
				<input type="hidden" name="initiativeId" value="${user.userId}" />
				<input type="submit" value="动态" />
			</form>
		</c:otherwise>
	</c:choose>
	<c:if test="${error != null}">
		<p>${error}</p>
	</c:if>
	<form action="sendMicroblog" method="post">
		<textarea rows="5" cols="35" name="content"></textarea><br/>
		<input type="hidden" name="user.userId" value="${user.userId}" />
		<input type="submit" value="发表" />
	</form>
</body>
</html>
